<html><head><title>Mail.pb</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font><font color="#006666">;   PureBasic - Mail example file
</font><font color="#006666">;
</font><font color="#006666">;    (c) Fantaisie Software
</font><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font>
<font color="#006666">InitNetwork</font>()


<b><font color="#006666">If</font></b> <font color="#006666">CreateMail</font>(0, "fred@purebasic.com", "Hello !")

<font color="#006666">  SetMailBody</font>(0, "Hello !" + <font color="#924B72">#CRLF$</font> + 
                 "This is a multi-" + <font color="#924B72">#CRLF$</font> +
                 "line mail !")
  
<font color="#006666">  AddMailAttachment</font>(0, "Geebee !"  , "Data/Geebee2.bmp")
<font color="#006666">  AddMailAttachment</font>(0, "World icon", "Data/world.png")
  
  <font color="#006666">; Change the recipients to real one
</font>  <font color="#006666">;
</font><font color="#006666">  AddMailRecipient</font>(0, "test@yourdomain.com", <font color="#924B72">#PB_Mail_To</font>)
<font color="#006666">  AddMailRecipient</font>(0, "test_cc@yourdomain.com", <font color="#924B72">#PB_Mail_Cc</font>)
  
  <font color="#006666">; Set the SMTP server to use
</font>  <font color="#006666">;
</font>  Result =<font color="#006666"> SendMail</font>(0, "smtp.free.fr", 25, 1)
  
  <b><font color="#006666">Repeat</font></b>
    Progress =<font color="#006666"> MailProgress</font>(0)
<font color="#006666">    Delay</font>(300)
  <b><font color="#006666">Until</font></b> Progress = <font color="#924B72">#PB_Mail_Finished</font> <b><font color="#006666">Or</font></b> Progress = <font color="#924B72">#PB_Mail_Error</font>
  
  <b><font color="#006666">If</font></b> Progress = <font color="#924B72">#PB_Mail_Finished</font>
<font color="#006666">    MessageRequester</font>("Information", "Mail correctly sent !")
  <b><font color="#006666">Else</font></b>
<font color="#006666">    MessageRequester</font>("Error", "Can't sent the mail !")
  <b><font color="#006666">EndIf</font></b>
  
<b><font color="#006666">EndIf</font></b>
</font></pre>
</body></html>
